package edu.ntu.cloudroid.nongui.com;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;

import com.sun.xacml.attr.DoubleAttribute;
import com.sun.xacml.ctx.Attribute;

import edu.ntu.cloudroid.xacml.XACMLStrings;

/**
 * @author anhdinh
 * Include the user's coordinates in the request
 */
public class VitalDataRequestWithInputs extends RequestNoInputs{

	private double heartRate=-1, bloodPressure=-1;
	
	public VitalDataRequestWithInputs(String requesterID, String requestedID,
			double hr, double bp) {
		super(requesterID, requestedID);		
		this.heartRate = hr;
		this.bloodPressure = bp;
	}

	public VitalDataRequestWithInputs(String requesterID, 
			double hr, double bp) {
		super(requesterID);
		this.heartRate = hr;
		this.bloodPressure = bp;
	}
			
	@Override
	public List<Attribute> getInputAttributes() throws Exception{
		List<Attribute> list = new ArrayList<Attribute>();
		
		 // add the subject's latitude
	      list.add(new Attribute(new URI(XACMLStrings.ATTR_HeartRate), null,
	            null, new DoubleAttribute(this.heartRate)));

	      // add the subject's longitude
	      list.add(new Attribute(new URI(XACMLStrings.ATTR_BloodPressure), null,
	            null, new DoubleAttribute(this.bloodPressure)));
		return list;
	}


	public double getHeartRate() {
		return this.heartRate;
	}


	public double getBloodPressure() {
		return this.bloodPressure;
	}

	
}
